package com.timothy.chart;

import com.timothy.android.util.NumberUtil;

public class BaseChart {
	private int index;
	private int votes;
	private double share;
	private String fullColor;
	private String shadowColor;

	private String choiceText;//选项描述文本
	private int choiceTextSize;//选项字体大小
	private String choiceTextColor;//选项字体颜色
	private int choiceTextOrdinateX;//选项文本横坐标
	private int choiceTextOrdinateY;//选项文本纵坐标

	private int answerType;//选项结果样式( 1 display votes;2 display shares 3 display both)
	private String answerText;//选项结果文本
	private int answerTextSize;
	private String answerTextColor;
	private int answerTextOrdinateX;//选项横坐标
	private int answerTextOrdinateY;//选项纵坐标
	
	
	
	public BaseChart() {
		super();
	}

	public BaseChart(int index, int votes, int share, String fullColor,
			String choiceText, int choiceTextSize, String choiceTextColor,
			int choiceTextOrdinateX, int choiceTextOrdinateY, int answerType,
			String answerText, int answerTextSize, String answerTextColor,
			int answerTextOrdinateX, int answerTextOrdinateY) {
		super();
		this.index = index;
		this.votes = votes;
		this.share = share;
		this.fullColor = fullColor;
		this.choiceText = choiceText;
		this.choiceTextSize = choiceTextSize;
		this.choiceTextColor = choiceTextColor;
		this.choiceTextOrdinateX = choiceTextOrdinateX;
		this.choiceTextOrdinateY = choiceTextOrdinateY;
		this.answerType = answerType;
		this.answerText = answerText;
		this.answerTextSize = answerTextSize;
		this.answerTextColor = answerTextColor;
		this.answerTextOrdinateX = answerTextOrdinateX;
		this.answerTextOrdinateY = answerTextOrdinateY;
	}
	
	public int getIndex() {
		return index;
	}
	public void setIndex(int index) {
		this.index = index;
	}
	public int getVotes() {
		return votes;
	}
	public void setVotes(int votes) {
		this.votes = votes;
	}
	public double getShare() {
		return share;
	}
	public void setShare(double share) {
		this.share = share;
	}
	public String getFullColor() {
		return fullColor;
	}
	public void setFullColor(String fullColor) {
		this.fullColor = fullColor;
	}
	
	public String getShadowColor() {
		return shadowColor;
	}

	public void setShadowColor(String shadowColor) {
		this.shadowColor = shadowColor;
	}

	public String getChoiceText() {
		return choiceText;
	}
	public void setChoiceText(String choiceText) {
		this.choiceText = choiceText;
	}
	public int getChoiceTextSize() {
		return choiceTextSize;
	}
	public void setChoiceTextSize(int choiceTextSize) {
		this.choiceTextSize = choiceTextSize;
	}
	public String getChoiceTextColor() {
		return choiceTextColor;
	}
	public void setChoiceTextColor(String choiceTextColor) {
		this.choiceTextColor = choiceTextColor;
	}
	public int getChoiceTextOrdinateX() {
		return choiceTextOrdinateX;
	}
	public void setChoiceTextOrdinateX(int choiceTextOrdinateX) {
		this.choiceTextOrdinateX = choiceTextOrdinateX;
	}
	public int getChoiceTextOrdinateY() {
		return choiceTextOrdinateY;
	}
	public void setChoiceTextOrdinateY(int choiceTextOrdinateY) {
		this.choiceTextOrdinateY = choiceTextOrdinateY;
	}
	public int getAnswerType() {
		return answerType;
	}
	public void setAnswerType(int answerType) {
		this.answerType = answerType;
	}
	public String getAnswerText() {
		return answerText;
	}
	public void setAnswerText(String answerText) {
		this.answerText = answerText;
	}
	
	public void setAnswerText(int answerType) {
		switch (answerType){
		    case 1:this.answerText = String.valueOf(votes);break;
		    case 2:this.answerText = NumberUtil.formatData2Deci(share*100)+"%";break;
		    case 3:this.answerText = String.valueOf(votes)+" "+NumberUtil.formatData2Deci(share*100)+"%";
		}
	}
	public int getAnswerTextSize() {
		return answerTextSize;
	}
	public void setAnswerTextSize(int answerTextSize) {
		this.answerTextSize = answerTextSize;
	}
	public String getAnswerTextColor() {
		return answerTextColor;
	}
	public void setAnswerTextColor(String answerTextColor) {
		this.answerTextColor = answerTextColor;
	}
	public int getAnswerTextOrdinateX() {
		return answerTextOrdinateX;
	}
	public void setAnswerTextOrdinateX(int answerTextOrdinateX) {
		this.answerTextOrdinateX = answerTextOrdinateX;
	}
	public int getAnswerTextOrdinateY() {
		return answerTextOrdinateY;
	}
	public void setAnswerTextOrdinateY(int answerTextOrdinateY) {
		this.answerTextOrdinateY = answerTextOrdinateY;
	}

	@Override
	public String toString() {
		return "BaseChart [index=" + index + ", votes=" + votes + ", share="
				+ share + ", fullColor=" + fullColor + ", choiceText="
				+ choiceText + ", choiceTextSize=" + choiceTextSize
				+ ", choiceTextColor=" + choiceTextColor
				+ ", choiceTextOrdinateX=" + choiceTextOrdinateX
				+ ", choiceTextOrdinateY=" + choiceTextOrdinateY
				+ ", answerType=" + answerType + ", answerText=" + answerText
				+ ", answerTextSize=" + answerTextSize + ", answerTextColor="
				+ answerTextColor + ", answerTextOrdinateX="
				+ answerTextOrdinateX + ", answerTextOrdinateY="
				+ answerTextOrdinateY + "]";
	}
	
	
}
